<?php
/*
 * Created on March 3, 2008
 * @author allen
 */
include_once(dirname(__FILE__).'/../database/dbSchedules.php');
class testdbSchedules extends UnitTestCase {
  function testdbSchedulesModule() {

	schedule_person("One", "Mon", "9-12", "jane2077291234");
	$this->assertTrue (is_scheduled("One", "Mon", "9-12", "jane2077291234"));
	
	unschedule_person("One", "Mon", "9-12", "jane2077291234");
	$this->assertTrue (is_scheduled("One", "Mon", "9-12", "jane2077291234") == false);
	$this->assertTrue (check_valid_schedule("One", "Mon", "9-12"));
	$this->assertTrue (get_persons("One", "Mon", "9-12") == "jane2077291234");
	
	schedule_person("FamOne", "Mon", "9-12", "jane2077291234");
	$id = get_person_ids("FamOne", "Mon", "9-12");
	$this->assertTrue ($id[0] == "jane2077291234");
	
	schedule_person("Two", "Mon", "9-12", "jane2077291234");
	$this->assertTrue (is_scheduled("Two", "Mon", "9-12", "jane2077291234"));
    schedule_person("One", "Thu", "15-18", "jane2077291234");
	$this->assertTrue (is_scheduled("One", "Thu", "15-18", "jane2077291234"));

	schedule_person("Two", "Mon", "9-12", "cathy2077291234");
	$this->assertTrue (is_scheduled("Two", "Mon", "9-12", "cathy2077291234"));
    schedule_person("One", "Tue", "18-21", "cathy2077291234");
	$this->assertTrue (is_scheduled("One", "Tue", "18-21", "cathy2077291234"));

    schedule_person("Wkd", "Sun2", "9-12", "maxine2077291234");
	$this->assertTrue (is_scheduled("Wkd", "Sun2", "9-12", "maxine2077291234"));
    schedule_person("Wkd", "Sun3", "9-12", "maxine2077291234");
	$this->assertTrue (is_scheduled("Wkd", "Sun3", "9-12", "maxine2077291234"));

    schedule_person("Wkd", "Sun2", "17-21", "dan2077291234");
	$this->assertTrue (is_scheduled("Wkd", "Sun2", "17-21", "dan2077291234"));

    schedule_person("Wkd", "Sun3", "17-21", "lisa2077291234");
	$this->assertTrue (is_scheduled("Wkd", "Sun3", "17-21", "lisa2077291234"));

    schedule_person("Wkd", "Sun4", "9-12", "gayle2077291234");
	$this->assertTrue (is_scheduled("Wkd", "Sun4", "9-12", "gayle2077291234"));

    echo("testdbSchedules complete");
  }
}
?>
